package com.hdoit.apollo.web.cargo.modelconfig;

import com.hdoit.apollo.web.cargo.providers.CargoStateProvider;
import com.hdoit.apollo.web.cargo.providers.CargoTypeProvider;
import com.hdoit.apollo.web.cargo.providers.CategoryProvider;
import com.hdoit.apollo.web.cargo.providers.HideProvider;
import com.hdoit.apollo.web.cargo.providers.UnitProvider;
import com.tennetcn.web.component.attribute.DisplayNameAttribute;
import com.tennetcn.web.component.attribute.DropDownListAttribute;
import com.tennetcn.web.component.attribute.RequiredAttribute;
import com.tennetcn.web.component.attribute.base.ModelMetadataAttributeConfiguration;



/**
 * @author      humaoshu
 * @email       
 * @createtime  2018年03月31日 15:26:13
 * @comment
 */
public class CargoConfig extends ModelMetadataAttributeConfiguration{
    public CargoConfig(){
        this.setProperty("cargoNo")
        	
            .hasAttribute(new DisplayNameAttribute("编号"))
            .hasAttribute(new RequiredAttribute("必填"));

        this.setProperty("cargoName")
            .hasAttribute(new DisplayNameAttribute("商品名称"))
            .hasAttribute(new RequiredAttribute("必填"));
        
        this.setProperty("cargoType")
         	.hasAttribute(new DropDownListAttribute(new CargoTypeProvider()))
	        .hasAttribute(new DisplayNameAttribute("商品类型"))
	        .hasAttribute(new RequiredAttribute("必填"));

        this.setProperty("shapeCode")
        	.hasAttribute(new DisplayNameAttribute("条形码"));
        
        this.setProperty("describes")
            .hasAttribute(new DisplayNameAttribute("商品描述"));
        
        this.setProperty("viceFirstUnit")
	        .hasAttribute(new DropDownListAttribute(new UnitProvider()))
	        .hasAttribute(new DisplayNameAttribute("辅助单位1"));
        
        this.setProperty("viceSecondUnit")
	        .hasAttribute(new DropDownListAttribute(new UnitProvider()))
	        .hasAttribute(new DisplayNameAttribute("辅助单位2"));
        
        this.setProperty("firstRatio")
        	.hasAttribute(new DisplayNameAttribute("="));
        
        this.setProperty("secondRatio")
        	.hasAttribute(new DisplayNameAttribute("="));
        
        this.setProperty("unit")
        	.hasAttribute(new DropDownListAttribute(new UnitProvider()))
        	.hasAttribute(new DisplayNameAttribute("基本单位"))
        	.hasAttribute(new RequiredAttribute("必填"));

        this.setProperty("cargoState")
        	.hasAttribute(new DropDownListAttribute(new CargoStateProvider()))
            .hasAttribute(new DisplayNameAttribute("货品状态"));

        this.setProperty("categoryName")
        	.hasAttribute(new DropDownListAttribute(new CategoryProvider()))
            .hasAttribute(new DisplayNameAttribute("物品分类"));

        this.setProperty("isStockWarning")
        	.hasAttribute(new DropDownListAttribute(new HideProvider()))
            .hasAttribute(new DisplayNameAttribute("是否库存预警"));

        this.setProperty("lowSafetyStock")
            .hasAttribute(new DisplayNameAttribute("最低安全库存"));

        this.setProperty("heightSafetyStock")
            .hasAttribute(new DisplayNameAttribute("最高安全库存"));

        this.setProperty("isHideSalePrice")
        	.hasAttribute(new DropDownListAttribute(new HideProvider()))
            .hasAttribute(new DisplayNameAttribute("隐藏微店货品销售价"));

        this.setProperty("isHideStock")
        	.hasAttribute(new DropDownListAttribute(new HideProvider()))
            .hasAttribute(new DisplayNameAttribute("隐藏微店货品库存"));

        this.setProperty("isHideSaleVolume")
        	.hasAttribute(new DropDownListAttribute(new HideProvider()))
            .hasAttribute(new DisplayNameAttribute("隐藏微店货品销量"));

        this.setProperty("shopId")
            .hasAttribute(new DisplayNameAttribute("门店id"));
        
        this.setProperty("comment")
        .hasAttribute(new DisplayNameAttribute("备注"));

    }
}